from enum import Enum
from pydantic import BaseModel
from typing import Any


class Status(Enum):
    """业务响应状态码，定义 0 成功， 1 失败"""
    SUCCESS: int = 0
    FAIL: int = 1


class Response(BaseModel):
    """响应基类"""
    status: Status
    message: Any


class SuccessResponse(Response):
    """正常响应模型"""
    status = Status.SUCCESS


class FailResponse(Response):
    """错误响应模型"""
    status = Status.FAIL
